package com.pactera.miyuangroup.controller.web;

import com.baomidou.mybatisplus.plugins.Page;
import com.pactera.miyuangroup.db.entity.Replenishment;
import com.pactera.miyuangroup.filter.CurrentUser;
import com.pactera.miyuangroup.service.ReplenishmentService;
import com.pactera.miyuangroup.vo.request.PageRequest;
import com.pactera.miyuangroup.vo.request.web.ReplenishmentRequest;
import com.pactera.miyuangroup.vo.response.ResultModel;
import com.pactera.miyuangroup.vo.response.User;
import com.pactera.miyuangroup.vo.response.web.ReplenishmentRes;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(description = "补货记录")
@RestController
@RequestMapping("replenishment")
public class ReplenishmentController {

    @Autowired
    private ReplenishmentService replenishmentService;

    /*
     * 查询捕获记录列表
     * */

    @ApiOperation(value = "补货记录列表", notes = "补货记录列表")
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    private ResultModel<Page<ReplenishmentRes>> getList(@CurrentUser User user, @RequestBody ReplenishmentRequest replenishmentRequest) {

        Page<ReplenishmentRes> repList = replenishmentService.getReplenishmentList(replenishmentRequest, user.getOrgId());

        return ResultModel.ok(repList);
    }


}